package com.example.score.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Objects;

/**
 * @author fsyj
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class Group {
    private String groupName;
    private Integer groupIndex;
    private Integer memberCount;
    private String area;
    private String date;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Group group = (Group) o;
        return groupName.equals(group.groupName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(groupName);
    }

    public void memberIncrement() {
        memberCount++;
    }
}
